import sun.misc.Unsafe;

import java.lang.reflect.Field;

/**
 * @author 龙小虬
 * @date 2021/4/22 12:29
 */
public class UnSafeUtils {

    public static Unsafe getUnsafe() {
        try {
            Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe");
            theUnsafe.setAccessible(true);
            return (Unsafe) theUnsafe.get(null);
        } catch (Exception e) {
            return null;
        }
    }

}
